 package server;


import client.MapleClient;
import client.inventory.Equip;
import client.inventory.Item;
import client.inventory.MapleAndroid;
import client.inventory.MapleEquipOnlyId;
import com.alibaba.druid.pool.DruidPooledConnection;
import database.DatabaseConnection;
import handling.cashshop.handler.MTSOperation;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;

import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.List;















 public class MTSItemsInfo {
/*  18 */   private static final Logger log = LogManager.getLogger(MTSItemsInfo.class);
/*  19 */   private static final MTSItemsInfo instance = new MTSItemsInfo();
/*  20 */   private List<MTSItemsInfo> Mtsitems = new ArrayList<>();

   private int id;
   private int accid;
   private int itemid;
   private int quantity;
   private int cid;
   private String Owner;
   private int other_id;
   private String other;
   private long Price;
   private long TotalPrice;
   private int type;
   private int state;
   private long startdate;
   private long expiredate;
   private long donedate;
   private Item spItem;
   private int character_id;
   private int result;
   private int buyNumber;

   public MTSItemsInfo() {}

   public MTSItemsInfo(int id, int accid, int cid, String owner, int other_id, String other, int itemid, int quantity, long price, long TotalPrice, int type, int state, long startdate, long expiredate, long donedate, Item spItem) {
/*  45 */     this.id = id;
/*  46 */     this.accid = accid;
/*  47 */     this.cid = cid;
/*  48 */     this.Owner = owner;
/*  49 */     this.other_id = other_id;
/*  50 */     this.other = other;
/*  51 */     this.itemid = itemid;
/*  52 */     this.quantity = quantity;
/*  53 */     this.Price = price;
/*  54 */     this.TotalPrice = TotalPrice;
/*  55 */     this.type = type;
/*  56 */     this.state = state;
/*  57 */     this.startdate = startdate;
/*  58 */     this.expiredate = expiredate;
/*  59 */     this.donedate = donedate;
/*  60 */     this.spItem = spItem;
   }




   public MTSItemsInfo(int character_id, int id, int accid, int cid, String owner, int other_id, String other, int itemid, int quantity, long price, long TotalPrice, int type, int state, int buynumber, int result, long startdate, long expiredate, long donedate, Item spItem) {
/*  67 */     this.character_id = character_id;
/*  68 */     this.id = id;
/*  69 */     this.accid = accid;
/*  70 */     this.cid = cid;
/*  71 */     this.Owner = owner;
/*  72 */     this.other_id = other_id;
/*  73 */     this.other = other;
/*  74 */     this.itemid = itemid;
/*  75 */     this.quantity = quantity;
/*  76 */     this.Price = price;
/*  77 */     this.TotalPrice = TotalPrice;
/*  78 */     this.type = type;
/*  79 */     this.state = state;
/*  80 */     this.buyNumber = buynumber;
/*  81 */     this.result = result;
/*  82 */     this.startdate = startdate;
/*  83 */     this.expiredate = expiredate;
/*  84 */     this.donedate = donedate;
/*  85 */     this.spItem = spItem;
   }

   public static MTSItemsInfo getInstance() {
/*  89 */     return instance;
   }




   public void getItemList(MapleClient c) {
/*  96 */     getMtsItemInfo(c, 0, -1, 2);
   }




   public void getItemSell(MapleClient c, int cid) {
/* 103 */     getMtsItemInfo(c, cid, -1, 1);
   }




   public void getItemSearch(MapleClient c, int state) {
/* 110 */     getMtsItemInfo(c, 0, state, 4);
   }




   public void getItemQuotation(MapleClient c) {
/* 117 */     getMtsItemInfo(c, 0, -1, 5);
   }




   public void getItemQuotationSearch(MapleClient c, int state) {
/* 124 */     getMtsItemInfo(c, 0, state, 6);
   }


   public void getMtsItemInfo(MapleClient c, int cid, int state, int option) {
/* 129 */     Mtsitems().clear();
/* 130 */     MapleItemInformationProvider ii = MapleItemInformationProvider.getInstance();
/* 131 */     try (DruidPooledConnection con = DatabaseConnection.getInstance().getConnection()) {
/* 132 */       PreparedStatement ps; String sql = "";
/* 133 */       if (option == 1) {

/* 135 */         ps = con.prepareStatement("SELECT * FROM auction where cid = ?");
/* 136 */         ps.setInt(1, cid);
/* 137 */       } else if (option == 2) {

/* 139 */         ps = con.prepareStatement("SELECT * FROM auction ORDER by id DESC limit 0,240");
/* 140 */       } else if (option == 4) {

/* 142 */         ps = con.prepareStatement("SELECT * FROM auction where states = ? limit 0,240");
/* 143 */         ps.setInt(1, state);
/* 144 */       } else if (option == 5) {

/* 146 */         ps = con.prepareStatement("SELECT * FROM auction_quotation ORDER by id DESC limit 0,240");
/* 147 */       } else if (option == 6) {

/* 149 */         ps = con.prepareStatement("SELECT * FROM auction_quotation where states = ? limit 0,240");
/* 150 */         ps.setInt(1, state);
       } else {
         return;
       }
/* 154 */       ResultSet rs = ps.executeQuery();
/* 155 */       while (rs.next()) {
/* 156 */         setId(rs.getInt("id"));
/* 157 */         setAccid(rs.getInt("accid"));
/* 158 */         setCid(rs.getInt("cid"));
/* 159 */         setOwner(rs.getString("sell"));
/* 160 */         setOther_id(rs.getInt("other_id"));
/* 161 */         setOther(rs.getString("other"));
/* 162 */         setType(rs.getInt("type"));
/* 163 */         setState(rs.getInt("states"));
/* 164 */         setItemid(rs.getInt("itemid"));
/* 165 */         setQuantity(rs.getInt("quantity"));
/* 166 */         setPrice(rs.getLong("Price"));
/* 167 */         setTotalPrice(rs.getLong("TotalPrice"));
/* 168 */         setStartdate(rs.getLong("startdate"));
/* 169 */         setExpiredate(rs.getLong("expiredate"));
/* 170 */         setDonedate(rs.getLong("donedate"));
/* 171 */         ItemsInfo(ii, rs);

/* 173 */         if (option != 5 && option != 6 && rs.getInt("quantity") == 0) {
/* 174 */           DeleteAuctionItem(rs.getInt("id"));

           continue;
         }
/* 178 */         if (option != 5 && option != 6 && System.currentTimeMillis() > getExpiredate()) {

/* 180 */           DeleteAuctionItem(rs.getInt("id"));

/* 182 */           MTSOperation.AuctionDoneSell(c, this.spItem, getQuantity(), getType(), getPrice(), getTotalPrice(), getAccid(), getCid(), getOwner(), 0, "", -1L, -1L, System.currentTimeMillis(), 4, getQuantity(), 4);

           continue;
         }

/* 187 */         MTSItemsInfo Mtsitem = new MTSItemsInfo(getId(), getAccid(), getCid(), getOwner(), getOther_id(), getOther(), getItemid(), getQuantity(), getPrice(), getTotalPrice(), getType(), getState(), getStartdate(), getExpiredate(), getDonedate(), this.spItem);
/* 188 */         Mtsitems().add(Mtsitem);
       }
/* 190 */       rs.close();
/* 191 */       ps.close();
/* 192 */     } catch (SQLException ex) {
/* 193 */       log.error("载入拍卖出错", ex);
     }
   }














   public void getItemDone(MapleClient c, int character_id) {
/* 211 */     Mtsitems().clear();
/* 212 */     MapleItemInformationProvider ii = MapleItemInformationProvider.getInstance();
/* 213 */     try (DruidPooledConnection con = DatabaseConnection.getInstance().getConnection()) {
/* 214 */       PreparedStatement ps = con.prepareStatement("SELECT * FROM auction_done where character_id = ?");
/* 215 */       ps.setInt(1, character_id);
/* 216 */       ResultSet rs = ps.executeQuery();
/* 217 */       while (rs.next()) {
/* 218 */         setId(rs.getInt("id"));
/* 219 */         setCharacter_id(rs.getInt("character_id"));
/* 220 */         setAccid(rs.getInt("sell_accid"));
/* 221 */         setCid(rs.getInt("sell_cid"));
/* 222 */         setOwner(rs.getString("sell_name"));
/* 223 */         setOther_id(rs.getInt("other_id"));
/* 224 */         setOther(rs.getString("other_name"));
/* 225 */         setType(rs.getInt("type"));
/* 226 */         setState(rs.getInt("states"));
/* 227 */         setBuyNumber(rs.getInt("buynumber"));
/* 228 */         setResult(rs.getInt("result"));
/* 229 */         setItemid(rs.getInt("itemid"));
/* 230 */         setQuantity(rs.getInt("quantity"));
/* 231 */         setPrice(rs.getLong("Price"));
/* 232 */         setTotalPrice(rs.getLong("TotalPrice"));
/* 233 */         setStartdate(rs.getLong("startdate"));
/* 234 */         setExpiredate(rs.getLong("expiredate"));
/* 235 */         setDonedate(rs.getLong("donedate"));
/* 236 */         ItemsInfo(ii, rs);

/* 238 */         if (rs.getInt("quantity") == 0) {
/* 239 */           DeleteAuctionItem(rs.getInt("id"));
           continue;
         }
/* 242 */         MTSItemsInfo Mtsitem = new MTSItemsInfo(c.getPlayer().getId(), getId(), getAccid(), getCid(), getOwner(), getOther_id(), getOther(), getItemid(), getQuantity(), getPrice(), getTotalPrice(), getType(), getState(), getBuyNumber(), getResult(), getStartdate(), getExpiredate(), getDonedate(), this.spItem);
/* 243 */         Mtsitems().add(Mtsitem);
       }
/* 245 */       rs.close();
/* 246 */       ps.close();
/* 247 */     } catch (SQLException ex) {
/* 248 */       log.error("载入完成窗口错误", ex);
     }
   }




   public MTSItemsInfo getItemsingleNum(int id) {
/* 256 */     MTSItemsInfo Mtsitem = null;
/* 257 */     MapleItemInformationProvider ii = MapleItemInformationProvider.getInstance();
/* 258 */     Mtsitems().clear();
/* 259 */     try (DruidPooledConnection con = DatabaseConnection.getInstance().getConnection()) {
/* 260 */       PreparedStatement ps = con.prepareStatement("SELECT * FROM auction where id = ?");
/* 261 */       ps.setInt(1, id);
/* 262 */       ResultSet rs = ps.executeQuery();
/* 263 */       if (rs.next()) {
/* 264 */         setId(rs.getInt("id"));
/* 265 */         setAccid(rs.getInt("accid"));
/* 266 */         setCid(rs.getInt("cid"));
/* 267 */         setOwner(rs.getString("sell"));
/* 268 */         setOther_id(rs.getInt("other_id"));
/* 269 */         setOther(rs.getString("other"));
/* 270 */         setType(rs.getInt("type"));
/* 271 */         setState(rs.getInt("states"));
/* 272 */         setItemid(rs.getInt("itemid"));
/* 273 */         setQuantity(rs.getInt("quantity"));
/* 274 */         setPrice(rs.getLong("Price"));
/* 275 */         setTotalPrice(rs.getLong("TotalPrice"));
/* 276 */         setStartdate(rs.getLong("startdate"));
/* 277 */         setExpiredate(rs.getLong("expiredate"));
/* 278 */         setDonedate(rs.getLong("donedate"));
/* 279 */         ItemsInfo(ii, rs);
/* 280 */         Mtsitem = new MTSItemsInfo(getId(), getAccid(), getCid(), getOwner(), getOther_id(), getOther(), getItemid(), getQuantity(), getPrice(), getTotalPrice(), getType(), getState(), getStartdate(), getExpiredate(), getDonedate(), this.spItem);
       }
/* 282 */       rs.close();
/* 283 */       ps.close();
/* 284 */     } catch (SQLException ex) {
/* 285 */       log.error("加载拍卖数据错误", ex);
     }
/* 287 */     return Mtsitem;
   }




   public MTSItemsInfo getDoneItemsingleNum(MapleClient c, int id) {
/* 294 */     MTSItemsInfo Mtsitem = null;
/* 295 */     MapleItemInformationProvider ii = MapleItemInformationProvider.getInstance();
/* 296 */     Mtsitems().clear();
/* 297 */     try (DruidPooledConnection con = DatabaseConnection.getInstance().getConnection()) {
/* 298 */       PreparedStatement ps = con.prepareStatement("SELECT * FROM auction_done where id = ?");
/* 299 */       ps.setInt(1, id);
/* 300 */       ResultSet rs = ps.executeQuery();
/* 301 */       if (rs.next()) {
/* 302 */         setId(rs.getInt("id"));
/* 303 */         setCharacter_id(rs.getInt("character_id"));
/* 304 */         setAccid(rs.getInt("sell_accid"));
/* 305 */         setCid(rs.getInt("sell_cid"));
/* 306 */         setOwner(rs.getString("sell_name"));
/* 307 */         setOther_id(rs.getInt("other_id"));
/* 308 */         setOther(rs.getString("other_name"));
/* 309 */         setType(rs.getInt("type"));
/* 310 */         setState(rs.getInt("states"));
/* 311 */         setBuyNumber(rs.getInt("buynumber"));
/* 312 */         setResult(rs.getInt("result"));
/* 313 */         setItemid(rs.getInt("itemid"));
/* 314 */         setQuantity(rs.getInt("quantity"));
/* 315 */         setPrice(rs.getLong("Price"));
/* 316 */         setTotalPrice(rs.getLong("TotalPrice"));
/* 317 */         setStartdate(rs.getLong("startdate"));
/* 318 */         setExpiredate(rs.getLong("expiredate"));
/* 319 */         setDonedate(rs.getLong("donedate"));
/* 320 */         ItemsInfo(ii, rs);
/* 321 */         Mtsitem = new MTSItemsInfo(c.getPlayer().getId(), getId(), getAccid(), getCid(), getOwner(), getOther_id(), getOther(), getItemid(), getQuantity(), getPrice(), getTotalPrice(), getType(), getState(), getBuyNumber(), getResult(), getStartdate(), getExpiredate(), getDonedate(), this.spItem);
       }
/* 323 */       rs.close();
/* 324 */       ps.close();
/* 325 */     } catch (SQLException ex) {
/* 326 */       log.error("加载拍卖完成数据错误", ex);
     }
/* 328 */     return Mtsitem;
   }


   private void ItemsInfo(MapleItemInformationProvider ii, ResultSet rs) throws SQLException {
/* 333 */     if (rs.getInt("type") == 1) {
/* 334 */       this.spItem = (Item)new Equip(rs.getInt("itemid"), (short)0, rs.getInt("uniqueid"), rs.getShort("flag"), rs.getShort("espos"));
/* 335 */       ((Equip)this.spItem).setUpgradeSlots(rs.getByte("upgradeslots"));
/* 336 */       ((Equip)this.spItem).setLevel(rs.getByte("level"));
/* 337 */       ((Equip)this.spItem).setStr(rs.getShort("str"));
/* 338 */       ((Equip)this.spItem).setDex(rs.getShort("dex"));
/* 339 */       ((Equip)this.spItem).setInt(rs.getShort("int"));
/* 340 */       ((Equip)this.spItem).setLuk(rs.getShort("luk"));
/* 341 */       ((Equip)this.spItem).setHp(rs.getShort("hp"));
/* 342 */       ((Equip)this.spItem).setMp(rs.getShort("mp"));
/* 343 */       ((Equip)this.spItem).setWatk(rs.getShort("watk"));
/* 344 */       ((Equip)this.spItem).setMatk(rs.getShort("matk"));
/* 345 */       ((Equip)this.spItem).setWdef(rs.getShort("wdef"));
/* 346 */       ((Equip)this.spItem).setMdef(rs.getShort("mdef"));
/* 347 */       ((Equip)this.spItem).setAcc(rs.getShort("acc"));
/* 348 */       ((Equip)this.spItem).setAvoid(rs.getShort("avoid"));
/* 349 */       ((Equip)this.spItem).setHands(rs.getShort("hands"));
/* 350 */       ((Equip)this.spItem).setSpeed(rs.getShort("speed"));
/* 351 */       ((Equip)this.spItem).setJump(rs.getShort("jump"));
/* 352 */       ((Equip)this.spItem).setViciousHammer(rs.getByte("ViciousHammer"));
/* 353 */       ((Equip)this.spItem).setItemEXP(rs.getLong("itemEXP"));
/* 354 */       ((Equip)this.spItem).setDurability(rs.getInt("durability"));
/* 355 */       ((Equip)this.spItem).setState(rs.getByte("state"), false);
/* 356 */       ((Equip)this.spItem).setEnhance(rs.getByte("enhance"));
/* 357 */       ((Equip)this.spItem).setPotential1(rs.getInt("potential1"));
/* 358 */       ((Equip)this.spItem).setPotential2(rs.getInt("potential2"));
/* 359 */       ((Equip)this.spItem).setPotential3(rs.getInt("potential3"));
/* 360 */       ((Equip)this.spItem).setState(rs.getByte("addState"), true);
/* 361 */       ((Equip)this.spItem).setPotential4(rs.getInt("potential4"));
/* 362 */       ((Equip)this.spItem).setPotential5(rs.getInt("potential5"));
/* 363 */       ((Equip)this.spItem).setPotential6(rs.getInt("potential6"));
/* 364 */       ((Equip)this.spItem).setIncSkill(rs.getInt("incSkill"));
/* 365 */       ((Equip)this.spItem).setPVPDamage(rs.getShort("pvpDamage"));
/* 366 */       ((Equip)this.spItem).setCharmEXP(rs.getShort("charmEXP"));
/* 367 */       ((Equip)this.spItem).setStateMsg(rs.getInt("statemsg"));
/* 368 */       ((Equip)this.spItem).setSocket1(rs.getInt("itemSlot1"));
/* 369 */       ((Equip)this.spItem).setSocket2(rs.getInt("itemSlot2"));
/* 370 */       ((Equip)this.spItem).setSocket3(rs.getInt("itemSlot3"));
/* 371 */       ((Equip)this.spItem).setItemSkin(rs.getInt("itemSkin"));
/* 372 */       ((Equip)this.spItem).setLimitBreak(rs.getLong("limitBreak"));

/* 374 */       ((Equip)this.spItem).setEnhanctBuff(rs.getShort("enhanctBuff"));
/* 375 */       ((Equip)this.spItem).setReqLevel(rs.getShort("reqLevel"));
/* 376 */       ((Equip)this.spItem).setYggdrasilWisdom(rs.getShort("yggdrasilWisdom"));
/* 377 */       ((Equip)this.spItem).setFinalStrike((rs.getShort("finalStrike") > 0));
/* 378 */       ((Equip)this.spItem).setBossDamage(rs.getShort("bossDamage"));
/* 379 */       ((Equip)this.spItem).setIgnorePDR(rs.getShort("ignorePDR"));

/* 381 */       ((Equip)this.spItem).setTotalDamage(rs.getShort("totalDamage"));
/* 382 */       ((Equip)this.spItem).setAllStat(rs.getShort("allStat"));
/* 383 */       ((Equip)this.spItem).setKarmaCount(rs.getShort("karmaCount"));
/* 384 */       ((Equip)this.spItem).setFire(rs.getLong("fire"));

/* 386 */       ((Equip)this.spItem).setSealedLevel(((Equip)this.spItem).isSealedEquip() ? (byte)Math.max(1, rs.getByte("sealedlevel")) : 0);
/* 387 */       ((Equip)this.spItem).setSealedExp(rs.getLong("sealedExp"));

/* 389 */       ((Equip)this.spItem).setSoulName(rs.getShort("soulname"));
/* 390 */       ((Equip)this.spItem).setSoulEnchanter(rs.getShort("soulenchanter"));
/* 391 */       ((Equip)this.spItem).setSoulPotential(rs.getShort("soulpotential"));
/* 392 */       ((Equip)this.spItem).setSoulSkill(rs.getInt("soulskill"));
/* 393 */       ((Equip)this.spItem).setARC(rs.getShort("arc"));
/* 394 */       ((Equip)this.spItem).setARCExp(rs.getInt("arcexp"));
/* 395 */       ((Equip)this.spItem).setARCLevel(rs.getShort("arclevel"));



/* 399 */       if (((Equip)this.spItem).getReqLevel() <= 0) {
/* 400 */         ((Equip)this.spItem).setReqLevel((short)MapleItemInformationProvider.getInstance().getReqLevel(this.spItem.getItemId()));
       }



/* 405 */       if (((Equip)this.spItem).getCharmEXP() < 0) {
/* 406 */         ((Equip)this.spItem).setCharmEXP(((Equip)ii.getEquipById(this.spItem.getItemId())).getCharmEXP());
       }



/* 411 */       if (((Equip)this.spItem).getBossDamage() <= 0 && ii.getBossDamageRate(this.spItem.getItemId()) > 0) {
/* 412 */         ((Equip)this.spItem).setBossDamage((short)ii.getBossDamageRate(this.spItem.getItemId()));
       }
/* 414 */       if (((Equip)this.spItem).getIgnorePDR() <= 0 && ii.getIgnoreMobDmageRate(this.spItem.getItemId()) > 0) {
/* 415 */         ((Equip)this.spItem).setIgnorePDR((short)ii.getIgnoreMobDmageRate(this.spItem.getItemId()));
       }
/* 417 */       if (((Equip)this.spItem).getTotalDamage() <= 0 && ii.getTotalDamage(this.spItem.getItemId()) > 0) {
/* 418 */         ((Equip)this.spItem).setTotalDamage((short)ii.getTotalDamage(this.spItem.getItemId()));
       }
/* 420 */       if (((Equip)this.spItem).getPotential1() == 0 && ii.getOption(this.spItem.getItemId(), 1) > 0) {
/* 421 */         ((Equip)this.spItem).setPotential1(ii.getOption(this.spItem.getItemId(), 1));
       }
/* 423 */       if (((Equip)this.spItem).getPotential2() == 0 && ii.getOption(this.spItem.getItemId(), 2) > 0) {
/* 424 */         ((Equip)this.spItem).setPotential2(ii.getOption(this.spItem.getItemId(), 2));
       }
/* 426 */       if (((Equip)this.spItem).getPotential3() == 0 && ii.getOption(this.spItem.getItemId(), 3) > 0) {
/* 427 */         ((Equip)this.spItem).setPotential3(ii.getOption(this.spItem.getItemId(), 3));
       }



/* 432 */       if (((Equip)this.spItem).getItemSkin() > 0 && !ii.itemExists(((Equip)this.spItem).getItemSkin())) {
/* 433 */         ((Equip)this.spItem).setItemSkin(0);
       }
/* 435 */       if (this.spItem.getUniqueId() > -1 && 
/* 436 */         this.spItem.getItemId() / 10000 == 166) {
/* 437 */         MapleAndroid android = MapleAndroid.loadFromDb(this.spItem.getItemId(), this.spItem.getUniqueId());
/* 438 */         if (android != null) {
/* 439 */           ((Equip)this.spItem).setAndroid(android);
         }
       }

/* 443 */       if (this.spItem.hasSetOnlyId()) {
/* 444 */         this.spItem.setEquipOnlyId(MapleEquipOnlyId.getInstance().getNextEquipOnlyId());
       }
     } else {
/* 447 */       this.spItem = new Item(rs.getInt("itemid"), (short)0, rs.getShort("quantity"), rs.getShort("flag"), rs.getInt("uniqueid"), rs.getShort("espos"));
/* 448 */       this.spItem.setOwner(rs.getString("itemOwner"));
/* 449 */       this.spItem.setExpiration(rs.getLong("itemexpiredate"));
/* 450 */       this.spItem.setGiftFrom(rs.getString("sender"));
     }
   }





   public void DeleteAuctionItem(int id) throws SQLException {
/* 459 */     DruidPooledConnection con = DatabaseConnection.getInstance().getConnection();


/* 462 */     PreparedStatement ps = con.prepareStatement("SELECT * FROM auction where id = ?");
/* 463 */     ps.setInt(1, id);
/* 464 */     ResultSet rs = ps.executeQuery();
/* 465 */     if (rs.next()) {
/* 466 */       ps = con.prepareStatement("delete from auction where id = ?");
/* 467 */       ps.setInt(1, id);
/* 468 */       ps.executeUpdate();
/* 469 */       ps.close();
     }
   }




   public void UpdateItemQuantity(int id, long meso, long totalmeso, int quantity) throws SQLException {
/* 477 */     DruidPooledConnection con = DatabaseConnection.getInstance().getConnection();


/* 480 */     PreparedStatement ps = con.prepareStatement("SELECT * FROM auction where id = ?");
/* 481 */     ps.setInt(1, id);
/* 482 */     ResultSet rs = ps.executeQuery();
/* 483 */     if (rs.next()) {
/* 484 */       ps = con.prepareStatement("update auction set Price = ?, TotalPrice = ?, quantity = ? where id = ?");
/* 485 */       ps.setLong(1, meso);
/* 486 */       ps.setLong(2, totalmeso);
/* 487 */       ps.setInt(3, quantity);
/* 488 */       ps.setInt(4, id);
/* 489 */       ps.executeUpdate();
/* 490 */       ps.close();
     }
   }




   public void UpdateItemState(int id, int states) throws SQLException {
/* 498 */     DruidPooledConnection con = DatabaseConnection.getInstance().getConnection();


/* 501 */     PreparedStatement ps = con.prepareStatement("SELECT * FROM auction_done where id = ?");
/* 502 */     ps.setInt(1, id);
/* 503 */     ResultSet rs = ps.executeQuery();
/* 504 */     if (rs.next()) {
/* 505 */       ps = con.prepareStatement("update auction_done set states = ? where id = ?");
/* 506 */       ps.setLong(1, states);
/* 507 */       ps.setInt(2, id);
/* 508 */       ps.executeUpdate();
/* 509 */       ps.close();
     }
   }


   public List<MTSItemsInfo> Mtsitems() {
/* 515 */     return this.Mtsitems;
   }

   public int getId() {
/* 519 */     return this.id;
   }

   public void setId(int id) {
/* 523 */     this.id = id;
   }

   public int getAccid() {
/* 527 */     return this.accid;
   }

   public void setAccid(int accid) {
/* 531 */     this.accid = accid;
   }

   public int getItemid() {
/* 535 */     return this.itemid;
   }

   public void setItemid(int itemid) {
/* 539 */     this.itemid = itemid;
   }

   public int getQuantity() {
/* 543 */     return this.quantity;
   }

   public void setQuantity(int quantity) {
/* 547 */     this.quantity = quantity;
   }

   public String getOwner() {
/* 551 */     return this.Owner;
   }

   public void setOwner(String Owner) {
/* 555 */     this.Owner = Owner;
   }

   public long getPrice() {
/* 559 */     return this.Price;
   }

   public void setPrice(long Price) {
/* 563 */     this.Price = Price;
   }

   public long getTotalPrice() {
/* 567 */     return this.TotalPrice;
   }

   public void setTotalPrice(long TotalPrice) {
/* 571 */     this.TotalPrice = TotalPrice;
   }

   public int getType() {
/* 575 */     return this.type;
   }

   public void setType(int type) {
/* 579 */     this.type = type;
   }

   public int getState() {
/* 583 */     return this.state;
   }

   public void setState(int state) {
/* 587 */     this.state = state;
   }

   public Item getSpItem() {
/* 591 */     return this.spItem;
   }

   public void setSpItem(Item spItem) {
/* 595 */     this.spItem = spItem;
   }

   public int getCid() {
/* 599 */     return this.cid;
   }

   public void setCid(int cid) {
/* 603 */     this.cid = cid;
   }

   public int getOther_id() {
/* 607 */     return this.other_id;
   }

   public void setOther_id(int other_id) {
/* 611 */     this.other_id = other_id;
   }

   public String getOther() {
/* 615 */     return this.other;
   }

   public void setOther(String other) {
/* 619 */     this.other = other;
   }

   public long getStartdate() {
/* 623 */     return this.startdate;
   }

   public void setStartdate(long startdate) {
/* 627 */     this.startdate = startdate;
   }

   public long getExpiredate() {
/* 631 */     return this.expiredate;
   }

   public void setExpiredate(long expiredate) {
/* 635 */     this.expiredate = expiredate;
   }

   public long getDonedate() {
/* 639 */     return this.donedate;
   }

   public void setDonedate(long donedate) {
/* 643 */     this.donedate = donedate;
   }

   public int getCharacter_id() {
/* 647 */     return this.character_id;
   }

   public void setCharacter_id(int character_id) {
/* 651 */     this.character_id = character_id;
   }

   public int getResult() {
/* 655 */     return this.result;
   }

   public void setResult(int result) {
/* 659 */     this.result = result;
   }

   public int getBuyNumber() {
/* 663 */     return this.buyNumber;
   }

   public void setBuyNumber(int buyNumber) {
/* 667 */     this.buyNumber = buyNumber;
   }
 }


/* Location:              C:\PGX\Server.jar!\server\MTSItemsInfo.class
 * Java compiler version: 8 (52.0)
 * JD-Core Version:       1.1.3
 */